import {COURSE} from '@/services/api'
import {request, METHOD} from '@/utils/request'

export async function listCourseByPage(currentPage, size) {
    return request(COURSE, METHOD.GET, {
        currentPage: currentPage,
        size: size
    })
}

export async function totalCourse() {
    return request(COURSE+"/total", METHOD.GET)
}

export async function deleteCourse(id) {
    return request(COURSE, METHOD.DELETE, {
        id: id
    })
}

export async function editCourse(course) {
    return request(COURSE, METHOD.POST, {
        id: course.id,
        name: course.name,
        code: course.code,
        typeId: course.typeId
    })
}
